<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2025/5/29
  Time: 14:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>我的收藏</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link type="text/css" rel="stylesheet" href="css/base.css">
    <link type="text/css" rel="stylesheet" href="css/common.css">
    <link type="text/css" rel="stylesheet" href="css/index.css">
    <script type="text/javascript" src="js/index.js" defer></script>
    <script type="text/javascript" src="js/goods.js"></script>
</head>
<body>

<jsp:include page="header.jsp">
    <jsp:param name="flag" value="2"/>
</jsp:include>

<div class="container goods-cart">
<%--    最上方的全选按钮--%>
    <div class="top-selectAll">
        <input type="checkbox" class="select-all-cbx" id="selectAllTop">
        <label for="selectAllTop" class="select-all-label">全选</label>
    </div>

    <form id="checkoutForm" action="order_list" method="get">
        <input type="hidden" id="selectedItems" name="selectedItems">

            <c:forEach items="${order.itemMap}" var="item">
                <%--    中间展示所有收藏的商品--%>
                <div class="goods-cart-item" data-price="${item.value.goods.price}" data-id="${item.value.goods.id}">
                        <%--        左边的选择框--%>
                    <input class="item-cbx" type="checkbox" data-id="${item.value.goods.id}" >
                        <%--    商品信息，给其外面套上a标签--%>
                    <div class="item-info">
                        <img class="item-img" src="${pageContext.request.contextPath }${item.value.goods.image1}">
                        <div class="item-details">
                            <span class="item-name">${item.value.goods.name}</span>
                        </div>
                        <span class="item-price">${item.value.goods.price}</span>
                            <%--            选择商品数量--%>
                        <div class="item-quantity">
                            <button class="btn-quantity btn-minus" type="button">-</button>
                            <input type="number" class="input-quantity" min="1" value="1" max="${item.value.goods.inventory}" name="total" data-id="${item.value.goods.id}" >
                            <button class="btn-quantity btn-plus" type="button">+</button>
                        </div>
                        <button class="item-delete-btn"  type="button">取消收藏</button>
                    </div>
                </div>
            </c:forEach>

        <div style="height: 60px"></div>
        <%--    最下方结算商品,显示在页面的最上方，固定在页面最底部--%>
        <div class="bottom-bar">
            <div class="summary">
                已选择<strong id="selectedNum">0</strong>件商品 &nbsp;|&nbsp; 总价: <span class="sum-money" id="totalPrice">￥0.00</span>
            </div>
            <button class="checkout-btn" type="button">去结算</button>
        </div>
    </form>



</div>

</body>
</html>
